package com.Shoping.entity;

import java.util.List;

public class PageBean<T> {
    private List<T> list;
    private int currentPath;//当前页数
    private int pageSize;//显示行数
    private long totalCount;//总行数
    private int totalPath;//总页数

    public PageBean() {
    }

    public PageBean(List<T> list, int currentPath, int pageSize, long totalCount) {
        this.list = list;
        this.currentPath = currentPath;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        setTotalPath((int) Math.ceil(this.totalCount*1.0/this.pageSize));
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getCurrentPath() {
        return currentPath;
    }

    public void setCurrentPath(int currentPath) {
        this.currentPath = currentPath;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPath() {
        return totalPath;
    }

    public void setTotalPath(int totalPath) {
        this.totalPath = totalPath;
    }
}

